<HTML>
<HEAD><TITLE>Tips Calculation !!!</TITLE>
</HEAD>
<BODY bgcolor="white">
<SCRIPT language="javascript">
{literal}
window.name = 'displayAll';
function changeItem()
{
  document.form1.changedField.value = "itemId";
  document.form1.submit();
}
{/literal}
</SCRIPT>
<a href="index.php">Home</a>&nbsp;&nbsp;&nbsp;<a href="txtFileF_O.php">Upload File F_O</a>&nbsp;&nbsp;&nbsp;	<a href="bhavCopyListF_O2.php">List F_O All</a>
<CENTER>
<FORM name="form1" method="POST" action="{$PHP_SELF}">
<INPUT type="hidden" name="display" value="{$display}">
<INPUT type="hidden" name="itemIdChanged" value="0">
  Exchange: 
    <SELECT name="exchange" value="F_O" onChange="document.form1.submit();">
    {html_options selected="$selectedExchange" values="$exchangeValue" output="$exchangeValue"}
    </SELECT>

  From Date : 
    {html_select_date time="$fromDate" prefix="fromDate" start_year="-1" end_year="+1" month_format="%m" field_order="DMY" day_value_format="%02d"}
  
  To Date : 
    {html_select_date time="$toDate" prefix="toDate" start_year="-1" end_year="+1" month_format="%m" field_order="DMY" day_value_format="%02d"}
  
  Item :
    <SELECT name="itemId" onChange="document.form1.itemIdChanged.value=1;document.form1.submit();">
    	<option value="A-G">A-G</option>
    	<option value="H-M">H-M</option>
    	<option value="N-T">N-T</option>
    	<option value="U-Z">U-Z</option>
    {html_options selected="$itemIdSelected" values="$itemIdValues" output="$itemIdOptions"}
    </SELECT>
  
  Expiry Date : 
    <SELECT name="expiryDate" onChange="document.form1.submit();"> 
    {html_options selected="$expiryDateSelected" values="$expiryDateValues" output="$expiryDateOptions"}
   </SELECT>
   
  Sort By : 
    <SELECT name="sortBy" onChange="document.form1.submit();"> 
    {html_options selected="$sortingSelected" values="$sortValuesArr" output="$sortOutputArr"}
   </SELECT>   
  
    <INPUT type="submit" name="submitBtn" value="Go" >
  </FORM>
  </CENTER>
  <TABLE border="1" cellSpacing="0" cellPadding="2" align="center" width="90%" style="font-weight: bold; font-size: 16px;">
    <TR bgcolor="pink">
        <TH NOWRAP><font color="blue">WeekDay</font></TH> 	 
        {if $displayItemName eq '1'}
        	<TH NOWRAP><font color="blue">Item Name</font></TH> 	 
        	<TH NOWRAP><font color="blue">Expiry Date</font></TH> 	 
        {/if}
        <TH NOWRAP><font color="blue">Date</font></TH> 	 
        <TH NOWRAP><font color="blue">Open</font></TH>
        <TH NOWRAP><font color="blue">High</font></TH>
        <TH NOWRAP><font color="blue">Low</font></TH>
      <TH NOWRAP><font color="blue">Close</font></TH>
      <TH align="right"><font color="blue">Lot Size</font></TD>
      <TH align="right"><font color="blue">OI Total</font></TD>
      <TH align="right"><font color="blue">OI Total In Lots</font></TD>
			<TH align="right">&nbsp;</TD>
			<TH align="right">&nbsp;</TD>
    </TR>   
  	{section name=display loop=$highPrice}
  	  {if $displayCurrentRow[display] == "Y"}
				<TR>
				<TD NOWRAP align="center">{$weekDay[display]}</TD> 	
				{if $displayItemName eq '1'}
					<TD align="center">{$itemName[display]}</TD> 	 
					<TD NOWRAP align="center">{$expiryDateBc[display]}</TD> 	  	 
				{/if}
				
				<TD NOWRAP align="center">{$bhavcopyDate[display]}</TD> 	
				<TD align="right">{$openPrice[display]}</TD>
				
        {assign var='highDisplayed' value='0'}
				{section name=highSec loop=$highestHighItem}
				  {if $highestHighItem[highSec] == $itemName[display] && $highestHighPrice[highSec] == $highPrice[display]}
  	        <TD align="right" bgcolor="##FF0000">{$highPrice[display]}</TD>
  	        {assign var='highDisplayed' value='1'}
  	      {/if}
  	    {/section}
  	    {if $highDisplayed == '0'}
	        <TD align="right" >{$highPrice[display]}</TD>
	      {/if}
	       {assign var='lowDisplayed' value='0'}
	       {section name=lowSec loop=$lowestLowItem}
	      {if $lowestLowItem[lowSec] == $itemName[display] && $lowestLowPrice[lowSec] == $lowPrice[display]}
	        <TD align="right" bgcolor="##FF0000">{$lowPrice[display]}</TD>
	       {assign var='lowDisplayed' value='1'}
	        {/if}
  	    {/section}
  	    {if $lowDisplayed == '0'}
	        <TD align="right" >{$lowPrice[display]}</TD>
	      {/if}
				
				<TD align="right">{$closePrice[display]}</TD>
				<TD align="right">{$lotSize[display]}</TD>
				<TD align="right">{$openInterestTot[display]}</TD>
				{if $displayEndedContract[display] == 1}
					<TD align="right">{$openInterestInLotsTotPending[display]|string_format:"%.0f"}</TD>
					<TD align="right">{$openInterestInLotsTot[display]|string_format:"%.0f"}</TD>
					<TD align="right">{$endedOpenInterest[display]|string_format:"%.0f"}</TD>
				{else}
					<TD align="right">{$openInterestInLotsTot[display]|string_format:"%.0f"}</TD>
					<TD align="right">&nbsp;</TD>
					<TD align="right">&nbsp;</TD>
				{/if}
				</TD>
				</TR>   
	    {/if}
    {/section}  
  </TABLE>

</BODY>
</HTML>
									